home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / OCE Interfaces / ADSPSecure.p next >
Encoding:
Text File  |  1993-09-16  |  4.4 KB  |  160 lines  |  [TEXT/MPS ]

  1. {***********************************************************
  2.  
  3. Created: Sunday, February 7, 1993 at 4:54PM
  4.  ADSPSecure.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.     ••• Apple Confidential •••
  8.     ••• Provided with AOCE Beta seed under license agreement with   •••
  9.     ••• Apple Computer, Inc.  Use for any purpose other than        •••
  10.     ••• development of AOCE-based Macintosh products is a violation •••
  11.     ••• of the license agreement.                                   •••
  12.  
  13.   Copyright Apple Computer, Inc. 1990-1993
  14.   All rights reserved
  15.  
  16. ***********************************************************}
  17.  
  18.  
  19. {$IFC UNDEFINED UsingIncludes}
  20. {$SETC UsingIncludes:= 0}
  21. {$ENDC}
  22.  
  23. {$IFC NOT UsingIncludes}
  24.     UNIT ADSPSecure;
  25.     INTERFACE
  26. {$ENDC}
  27.  
  28. {$IFC UNDEFINED UsingADSPSecure}
  29. {$SETC UsingADSPSecure:= 1}
  30.  
  31. {$I+}
  32. {$SETC ADSPSecureIncludes:= UsingIncludes}
  33. {$SETC UsingIncludes:= 1}
  34.  
  35.  
  36. {$IFC UNDEFINED UsingADSP}
  37. {$I $$Shell(PInterfaces)ADSP.p}
  38. {$ENDC}
  39.  
  40. {$IFC UNDEFINED UsingFiles}
  41. {$I $$Shell(PInterfaces)Files.p}
  42. {$ENDC}
  43.  
  44. {$IFC UNDEFINED UsingOCE}
  45. {$I OCE.p}
  46. {$ENDC}
  47.  
  48. {$IFC UNDEFINED UsingOCEAuthDir}
  49. {$I OCEAuthDir.p}
  50. {$ENDC}
  51.  
  52. {$IFC UNDEFINED UsingTypes}
  53. {$I $$Shell(PInterfaces)Types.p}
  54. {$ENDC}
  55.  
  56. {$SETC UsingIncludes:= ADSPSecureIncludes}
  57.  
  58.  
  59. { New ADSP control codes }
  60.  
  61. CONST
  62. sdspOpen        = 229;                    { open a secure connection }
  63.  
  64.  
  65.  
  66.  
  67.  
  68. {
  69. For secure connections, the eom field of ioParams contains two single-bit flags
  70. (instead of a zero/non-zero byte). They are an encrypt flag (see below), and an
  71. eom flag.  All other bits in that field should be zero.
  72.  
  73. To write an encrypted message, you must set an encrypt bit in the eom field of
  74. the ioParams of your write call. Note: this flag is only checked on the first
  75. write of a message (the first write on a connection, or the first write following
  76. a write with eom set.
  77. }
  78.  
  79. dspEOMBit = 0;                            { set if EOM at end of write }
  80. dspEncryptBit = 1;                        { set to encrypt message }
  81.  
  82.  
  83. dspEOMMask            = $1;  {1<<dspEOMBit}
  84. dspEncryptMask        = $2;  {1<<dspEncryptBit}
  85.  
  86.  
  87.  
  88.  
  89.  
  90. {
  91. Define an ADSPSecure parameter block, as used for the secure Open call.
  92. }
  93.  
  94. sdspWorkSize    = 2048;                    { size of ADSPSecure workspace }
  95.  
  96. TYPE
  97. TRSecureParams = PACKED RECORD
  98.     localCID: INTEGER;                    { local connection id }
  99.     remoteCID: INTEGER;                    { remote connection id }
  100.     remoteAddress: AddrBlock;            { address of remote end }
  101.     filterAddress: AddrBlock;            { address filter }
  102.     sendSeq: LONGINT;                    { local send sequence number }
  103.     sendWindow: INTEGER;                { send window size }
  104.     recvSeq: LONGINT;                    { receive sequence number }
  105.     attnSendSeq: LONGINT;                { attention send sequence number }
  106.     attnRecvSeq: LONGINT;                { attention receive sequence number }
  107.     ocMode: Byte;                        { open connection mode }
  108.     ocInterval: Byte;                    { open connection request retry interval }
  109.     ocMaximum: Byte;                    { open connection request retry maximum }
  110.     secure: BOOLEAN;                    {  --> TRUE if session was authenticated }
  111.     sessionKey: AuthKeyPtr;                { <--> encryption key for session }
  112.     credentialsSize: LONGINT;            {  --> length of credentials }
  113.     credentials: Ptr;                    {  --> pointer to credentials }
  114.     workspace: Ptr;                        {  --> pointer to workspace for connection }
  115.                                         { align on even boundary and length = sdspWorkSize }
  116.     recipient: AuthIdentity;            {  --> identity of recipient (or initiator if active mode }
  117.     issueTime: UTCTime;                    {  --> when credentials were issued }
  118.     expiry: UTCTime;                    {  --> when credentials expiry }
  119.     initiator: RecordIDPtr;                { <--  RecordID of initiator returned here.
  120.                                             Must give appropriate Buffer to hold RecordID
  121.                                             (Only for passive or accept mode) }
  122.     hasIntermediary: BOOLEAN;            { <--  will be set if credentials has an intermediary }
  123.     intermediary: RecordIDPtr;            { <--  RecordID of intermediary returned here.
  124.                                             (If intermediary is found in credentials
  125.                                             Must give appropriate Buffer to hold RecordID
  126.                                             (Only for passive or accept mode) }
  127.     END;
  128.  
  129.  
  130.  
  131.  
  132. SDSPParamBlock = PACKED RECORD
  133.     CASE INTEGER OF
  134.         1: (dspParamBlock: DSPParamBlock);
  135.         2: (qLink: QElemPtr;
  136.             qType: INTEGER;
  137.             ioTrap: INTEGER;
  138.             ioCmdAddr: Ptr;
  139.             ioCompletion: ProcPtr;
  140.             ioResult: OSErr;
  141.             ioNamePtr: StringPtr;
  142.             ioVRefNum: INTEGER;
  143.             ioCRefNum: INTEGER;                    { adsp driver refNum }
  144.             csCode: INTEGER;                    { adsp driver control code }
  145.             qStatus: LONGINT;                    { adsp internal use }
  146.             ccbRefNum: INTEGER;                    { connection end refNum }
  147.             secureParams: TRSecureParams;        { dspOpenSecure }
  148.             );
  149.     END;
  150.  
  151.  
  152. SDSPPBPtr = ^SDSPParamBlock;
  153.  
  154.  
  155. {$ENDC}    { UsingADSPSecure }
  156.  
  157. {$IFC NOT UsingIncludes}
  158.     END.
  159. {$ENDC}
  160.